const directive = {
  inserted(el) {
    el.className = el.className ? `${el.className} v-transfer-dom` : 'v-transfer-dom';
    if (el.parentNode) el.parentNode.removeChild(el);
    document.body.appendChild(el);
    return true;
  },
  unbind(el) {
    el.className = el.className.replace('v-transfer-dom', '');
    document.body.removeChild(el);
    return true;
  },
};

export default directive;
